<?php
/**
 * User: dimka3210
 * Date: 19.11.13
 * Time: 19:48
 */
include_once('./core/autoload.php');
?>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="/static/css/my.css">
</head>
<body>
<?php
$limit = CNF::$params['paging']['limit'];
$offset = (isset($_GET['page'])) ? (intval($_GET['page']) - 1) * $limit : 0;
$storage = Storage::getInstance();
$news = $storage->getRows($limit, $offset);
?>

<table class="content">
    <tr>
        <th>Заголовок</th>
        <th class="data">Дата создания</th>
        <th class="data">Изменен</th>
    </tr>
    <?php foreach ($news as $row) { ?>
        <tr>
            <td><?= $row['title'] ?></td>
            <td class="data"><?= date('H:i d-m-Y', strtotime($row['create_date'])) ?></td>
            <td class="data"><?= date('H:i d-m-Y', strtotime($row['modify_date'])) ?></td>
        </tr>
        <tr>
            <td colspan="3"><?= $row['text'] ?></td>
        </tr>
    <?php } ?>
</table>
</body>
</html>